-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setting the config path through an environment variable #6444
Conversation
This change was primarily needed for the Docker image in the future, but I thought it might also be relevant to #6392. |
Might be nice to have a default config search path. e.g if no The docker image wouldn't need to specifiy the Env var as you have in the PR is still useful though. So 👍 on green. |
Needs changelog under features though. |
@e-dard this is useful for the Docker images. We won't be able to include it in the 0.12 images, but it should make the entrypoint script more simple for 0.13. |
@jwilder I'll add that in. What should be the order that's checked?
|
LGTM 👍 |
@jsternberg 3, 2, 1. More specific options overrides. The current config options work by using the config file, env var and finally CLI flags override those. Should work consistently with the existing model. |
efb30bd
to
c0e078e
Compare
The config path previously could only be specified through the command line options. This made it very difficult to set a default config path without using any option. Now the environment variable can be set so the default configuration path is set to a specific place, but can be overwritten using the command line option. The primary purpose of this is so the Docker container can have a default configuration file, but not have to parse the command line options to figure out if a different configuration file has been specified while still allowing the user to only type `influxd` and have the program start correctly. This might also help #6392 as it would allow a default configuration location to be included with the package by setting an environment variable. A default search path is also provided now with checking the following paths for a config file when none is specified: * `~/.influxdb/influxdb.conf` * `/etc/influxdb/influxdb.conf` The config command has also been modified to read this config file before outputting a sample config.
c0e078e
to
9c09023
Compare
👍 |
The config path previously could only be specified through the command
line options. This made it very difficult to set a default config path
without using any option.
Now the environment variable can be set so the default configuration
path is set to a specific place, but can be overwritten using the
command line option.
The primary purpose of this is so the Docker container can have a
default configuration file, but not have to parse the command line
options to figure out if a different configuration file has been
specified while still allowing the user to only type
influxd
and havethe program start correctly.
This might also help #6392 as it would allow a default configuration
location to be included with the package by setting an environment
variable.